package com.bosssoft.trainee.rbac.service.impl;

import com.bosssoft.trainee.rbac.dao.MenuDao;
import com.bosssoft.trainee.rbac.entity.dto.MenusDTO;
import com.bosssoft.trainee.rbac.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuServiceImpl implements MenuService {
    @Autowired
    private MenuDao menuDao;

    @Override
    public int updateRolesMenu(MenusDTO menusDTO) {
        return menuDao.updateRolesMenu(menusDTO);
    }

    @Override
    public int insertRolesMenu(MenusDTO menusDTO) {
        return menuDao.insertRolesMenu(menusDTO);
    }

    @Override
    public int deleteRolesMenu(Integer menuId) {
        return menuDao.deleteRolesMenu(menuId);
    }

    @Override
    public List<MenusDTO> getMenuByRoleId(Integer roleId) {
        return menuDao.getMenuByRoleId(roleId);
    }
}
